<%-- 
    Document   : xembaithi
    Created on : Sep 16, 2012, 10:12:32 PM
    Author     : Odotube
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="thitracnghiem.MonThi"%>
<%@page import="thitracnghiem.GiaoVien"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%@include file="/menugv.html"%>
        <%

            session = request.getSession();
            GiaoVien gv = (GiaoVien) session.getAttribute("gv");
            if (gv == null) {
                response.sendError(403);
                return;
            }
        %>
        <form action="/ThiTracNghiem/XuLy" method="post">
            <input type="hidden" name="yc" value="xembaithi">
            <%
                String s = "";
                s = request.getParameter("tb");
                if (s == null) {
                    s = "";
                }
                out.println(s);
            %>
            MSSV: <input type="text" name="masv">
            <%
                s = "Mon thi: ";
                MonThi.Open();
                ArrayList<MonThi> dsMonThi = MonThi.getDSMonThi(gv.getPhanQuyenMon());
                MonThi.Close();
                s += "<select name=monthi>";
                for (int i = 0; i < dsMonThi.size(); i++) {
                    s += "<option value=" + dsMonThi.get(i).getMaMonThi() + ">" + dsMonThi.get(i).getTenMonThi();
                }
                s += "</select>";
            %>
            <%=s%>
            Lan thi: <input type="text" name="lanthi">
            <input type="submit" value="Xem">
        </form>
        <%
            StringBuilder ms = new StringBuilder();
            ms.append(session.getAttribute("baithi"));
            if (!ms.equals("") && !ms.equals("null")) {
                out.println(ms);
            }
        %>
    </body>
</html>
